<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/white/common/common.jsp"%>
<%@include file="/white/common/taglibs.jsp"%>
<html>
	<head>
		<script type="text/javascript">
        <!--
        function submitForm(){
            var searchForm=document.getElementById("searchForm");
            searchForm.submit();
        }
        
       
        function validateModify(){        	
        	var check = document.getElementsByName("selectedIds");
        	var a = 0;
            var id;
            
           
            for(var i=0;i <check.length;i++){
                if(check[i].checked==true){
                    a++;
                    id = check[i].value;
                }
            }
            
            if(a == 1){        	
				var fields = id.split(",");
				var values = new Array(fields.length);

				for(j = 0; j < fields.length; j++) {
					values[j] = fields[j];
				}
				
				window.opener.document.forms[0].prodClassCode2.value = values[1];
				window.opener.document.forms[0].prodClassName2.value = values[2];
				
				window.close();
            }else{
                alert("请先选择一条记录!!");
                return false;
            }
        }        
     
        function displayResult(){
            var result = "<s:property value='result'/>";
            if(result != null && result != ""){
                alert(result);
            }
        }    
        
    //-->
    </script>
	</head>
	<body onload="displayResult()">
		<s:form method="post" action="prodClassAction!querySelTwoByPage.action"
			theme="simple" id="searchForm">
			<div id="div_title">
				<h3>
					产品分类选择
				</h3>
				<div id="div_search">
					<table>
						<tr>
							<!-- 查询条件 -->
							<td width="80" align="right">
								分类代码:
							</td>
							<td>
								<s:textfield name="query_code" />
							</td>
							<td width="80" align="right">
								分类名称:
							</td>
							<td>
								<s:textfield name="query_name" />
							</td>
							<td width="80" align="right">
								城市代码:
							</td>
							<td>
								<s:textfield name="query_cityCode" />
							</td>
							<td width="80" align="right">
								城市名称:
							</td>
							<td>
								<s:textfield name="query_cityName" />
							</td>
						</tr>
						<tr>
							<td width="80" align="right">
								逻辑次序:
							</td>
							<td>
								<s:textfield name="query_line" />
							</td>
							<td width="80" align="right">
								备注:
							</td>
							<td>
								<s:textfield name="query_note" />
							</td>
						</tr>
						<tr>
							<td width="80" align="right">
								<authz:authorize ifAnyGranted="OMC_PROD_CLASS">
									<s:submit cssClass="submit_search" value="搜索"
										action="prodClassAction!querySelTwoByPage" />
								</authz:authorize>
							</td>
						</tr>
					</table>
				</div>
			</div>
			<div id="div_button">
				<authz:authorize ifAnyGranted="OMC_PROD_CLASS">
					<s:submit value="选择" onclick="return validateModify()"
						cssClass="input_button" />
				</authz:authorize>
				<authz:authorize ifAnyGranted="OMC_PROD_CLASS">
					<s:submit value="关闭" onclick="window.close();"
						cssClass="input_button" />
				</authz:authorize>
			</div>
			<!--列表 开始 -->
			<table cellpadding="0" cellspacing="0" class="t_list">
				<tr>
					<th>
					</th>
					<!--列表头部 -->
					<th>
						分类代码
					</th>
					<th>
						分类名称
					</th>
					<th>
						逻辑次序
					</th>
					<th>
						城市代码
					</th>
					<th>
						城市名称
					</th>
					<th>
						备注
					</th>
					<th>
						类型
					</th>
					<th>
						状态
					</th>
				</tr>
				<s:iterator value="resultList" status="sindex">
					<tr>
						<td>
							<input type="radio" name="selectedIds"
								value="${ CLASS_ID },${ CODE },${ NAME }" id="selectedIds" />
						</td>
						<td>
							<s:property value="CODE" />
						</td>
						<td>
							<s:property value="NAME" />
						</td>
						<td>
							<s:property value="LINE" />
						</td>
						<td>
							<s:property value="CITY_CODE" />
						</td>
						<td>
							<s:property value="CITY_NAME" />
						</td>
						<td>
							<s:property value="NOTE" />
						</td>
						<td>
							<s:property value="TYPE" />
						</td>
						<td>
							<s:property value="STATUS" />
						</td>
					</tr>
				</s:iterator>
			</table>
			<!--列表 结束 -->
			<!--分页 开始 -->
			<s:if test="resultList.size() > 0">
				<table border="0" cellspacing="0" cellpadding="0" class="t_bottom">
					<tr>
						<td><%@include file="/white/common/pageList.jsp"%></td>
					</tr>
				</table>
			</s:if>
			<!--分页 结束 -->

		</s:form>
	</body>
</html>
